﻿<UserControl x:Class="Mal.Balades.Admin.Views.VisitViews.Edit.InformationsTab"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    xmlns:controls="clr-namespace:Mal.Balades.Admin.Controls"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    
    <Grid x:Name="LayoutRoot" Background="White">
        <CheckBox IsChecked="{Binding SourceVisit.QualityInformations,Mode=TwoWay}" />
        
        <data:DataGrid AutoGenerateColumns="False" Margin="0,50,0,0"
            ItemsSource="{Binding SourceVisit.Informations}">
            <data:DataGrid.Columns>

                <data:DataGridTemplateColumn Header="Type">
                    <data:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Grid>
                                <ComboBox 
                                    ItemsSource="{Binding InformationTypes}"
                                    SelectedItem="{Binding SelectedInformationType, Mode=TwoWay}">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding Name}" />
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                    
                                </ComboBox>
                                
                            </Grid>
                        </DataTemplate>
                    </data:DataGridTemplateColumn.CellTemplate>
                </data:DataGridTemplateColumn>

                <data:DataGridTemplateColumn Header="Text">
                    <data:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Grid>
                                <controls:HtmlTextEditor Height="100"
                                  Style="{StaticResource HtmlText}"
                                 Text="{Binding Text, Mode=TwoWay}" />
                            </Grid>
                        </DataTemplate>
                    </data:DataGridTemplateColumn.CellTemplate>
                </data:DataGridTemplateColumn>
             
            </data:DataGrid.Columns>
        </data:DataGrid>
    </Grid>
</UserControl>
